<html>
<head>
  <title>楼盘管理——楼盘列表</title>
  <meta name="layout" content="common_header"/>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.form.min.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.metadata.pack.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'common.custom.js', absolute: true)}"></script>
  <script type="text/javascript">
    function approveEstate(id, flag) {
      jQuery("#id").val(id)
      jQuery("#flag").val(flag)
      jQuery("#submitForm").ajaxSubmit({
        success: function(response) {
          if (response == "1") {
            jQuery("#approveFlag_" + id).html(flag == "1" ? "通过" : "不通过")
          } else {
            alert("审批出错")
          }
        }
      });
    }
  </script>
</head>
<body>
<div id="man_zone">
  <form id="submitForm" name="submitForm" action="${createLink(controller: "admin", action: 'approveEstate', absolute: true)}" method="post">
    <input type="hidden" id="id" name="id"/>
    <input type="hidden" id="flag" name="flag"/>
  </form>
  <form id="queryForm" name="queryForm" action="${createLink(controller: "scaffold", action: 'list', absolute: true)}" method="post">
    <input type="hidden" name="property" value="${params?.property}"/>
    <table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_style">
      <tr>
        <td class="left_title_1">楼盘名称</td>
        <td class="fillin">
          <input type="text" id="zlk_name" name="zlk_name" value="${params?.zlk_name}">
        </td>
        <td class="left_title_1">审核状态</td>
        <td class="fillin">
          <input type="radio" name="aeq_approveFlag" value="" <g:if test="${params?.aeq_approveFlag==''||params?.aeq_approveFlag==null}">checked</g:if>/> 全部
          <input type="radio" name="aeq_approveFlag" value="0" <g:if test="${params?.aeq_approveFlag=='0'}">checked</g:if>/>未审核
          <input type="radio" name="aeq_approveFlag" value="1" <g:if test="${params?.aeq_approveFlag=='1'}">checked</g:if>/>通过
          <input type="radio" name="aeq_approveFlag" value="2" <g:if test="${params?.aeq_approveFlag=='2'}">checked</g:if>/>不通过
        </td>
      </tr>
      <tr>
        <td class="fillin" colspan="4" align="center"><input type="image" src="${resource(dir: '/images/admin_ui/', file: 'query1.gif', absolute: true)}" alt="查询"/></td>
      </tr>
    </table>
  </form>
  <br>
  <table cellpadding="0" cellspacing="0" width="95%" align="center" class="xtable">
    <thead>
    <tr>
      <g:sortableColumn action="list" property="dateCreated" title="创建日期" params="${params}" action="${createLink(controller:"scaffold",action:'list',absolute:true)}"/>
      <g:sortableColumn action="list" property="name" title="楼盘名称" params="${params}" action="${createLink(controller:"scaffold",action:'list',absolute:true)}"/>
      <g:sortableColumn action="list" property="area" title="区域" params="${params}" action="${createLink(controller:"scaffold",action:'list',absolute:true)}"/>
      <g:sortableColumn action="list" property="sector" title="板块/商圈" params="${params}" action="${createLink(controller:"scaffold",action:'list',absolute:true)}"/>
      <th>地址</th>
      <!--<th>提供人</th>-->
      <th>审核状态</th>
      <th>楼盘照片(入库/未入)</th>
      <th>房型照片(入库/未入)</th>
      <th>提供人</th>
      <th>查看</th>
    </tr>
    </thead>
    <tbody>
    <g:each in="${list.items}">
      <tr>
        <td align="center"><g:formatDate format="yyyy/MM/dd" date="${it.dateCreated}"/></td>
        <td align="center"><a maxLength="15">${it.name}</a></td>
        <td align="center">${it.areaName}</td>
        <td align="center">${it.sectorName}</td>
        <td align="center"><a maxLength="15">${it.address}</a></td>
        <!--<td  align="center"><a maxLength="15">${it.createUser?.displayName}</a></td>-->
        <td align="center" id="approveFlag_${it.id}"><g:if test="${it.approveFlag=='0'}"><a href="javaScript:approveEstate('${it.id}','1')">通过</a>|<a href="javaScript:approveEstate('${it.id}','2')">不通过</a></g:if><g:elseif test="${it.approveFlag=='1'}">通过</g:elseif><g:elseif test="${it.approveFlag=='2'}">不通过</g:elseif></td>
        <td align="center">
          <a href="${createLink(controller: 'estate', action: 'estatePic', absolute: true)}?okFlag=true&id=${it.id}&type=10"><font color="blue">${it.estAcceptPicNum}</font></a>/
          <a href="${createLink(controller: 'estate', action: 'estatePic', absolute: true)}?okFlag=false&id=${it.id}&type=10"><font color="blue">${it.estPicNum}</font></a>
        </td>
        <td align="center">
          <a href="${createLink(controller: 'estate', action: 'estatePic', absolute: true)}?okFlag=true&id=${it.id}&type=20"><font color="blue">${it.layoutAcceptPicNum}</font></a>/
          <a href="${createLink(controller: 'estate', action: 'estatePic', absolute: true)}?okFlag=false&id=${it.id}&type=20"><font color="blue">${it.layoutPicNum}</font></a>
        </td>
        <td width="10%" align="center">${it.createUser.name}</td>
        <td width="5%" align="center"><a href="${createLink(controller: 'scaffold', action: 'show', absolute: true)}?property=Estate&id=${it.id}"><img src="${resource(dir: '/images/admin_ui/', file: 'preview.gif', absolute: true)}" alt="查看"/></a></td>
      </tr>
    </g:each>
    </tbody>
    <tfoot>
    <tr>
      <td colspan="10" align="center">
        <g:paginate total="${list.count}" params="${params}"/>
      </td>
    </tr>
    </tfoot>
  </table>
</div>
</body>
</html>
